package com.cs.study.homework._0220;

public class Demo3 {
    public static void main(String[] args) {
        Animal cat = new Cat();
        Animal dog = new Dog();
        cat.shout();
        dog.shout();
    }
}

class Animal {
    String name;
    int age;

    public void shout() {
        System.out.println("can shout");
    }
}

class Cat extends Animal {
    String color;

    public Cat() {

    }

    @Override
    public void shout() {
        System.out.println("can catch mouse");
    }
}

class Dog extends Animal {
    boolean gender;

    public Dog() {

    }

    @Override
    public void shout() {
        System.out.println("can guard the entrance");
    }
}